home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
earcd
/
phase5
/
ppcrelease
/
autodocs
/
powerup.doc
next >
Wrap
Text File
|
1998-02-21
|
79KB
|
2,948 lines
TABLE OF CONTENTS
PowerUPKernel/PPCAdd64
PowerUPKernel/PPCAdd64p
PowerUPKernel/PPCAddHead
PowerUPKernel/PPCAddHeadSync
PowerUPKernel/PPCAddTail
PowerUPKernel/PPCAddTailSync
PowerUPKernel/PPCAllocMem
PowerUPKernel/PPCAllocPooled
PowerUPKernel/PPCAllocSignal
PowerUPKernel/PPCAllocVec
PowerUPKernel/PPCAllocVecPooled
PowerUPKernel/PPCAttemptSemaphore
PowerUPKernel/PPCAttemptSemaphoreByName
PowerUPKernel/PPCAttemptSemaphoreShared
PowerUPKernel/PPCAttemptSemaphoreSharedByName
PowerUPKernel/PPCCacheFlush
PowerUPKernel/PPCCacheFlushAll
PowerUPKernel/PPCCacheInvalid
PowerUPKernel/PPCCallM68k
PowerUPKernel/PPCCallOS
PowerUPKernel/PPCClose
PowerUPKernel/PPCCmp64
PowerUPKernel/PPCCmp64p
PowerUPKernel/PPCCreateMessage
PowerUPKernel/PPCCreatePool
PowerUPKernel/PPCCreatePort
PowerUPKernel/PPCCreateSemaphore
PowerUPKernel/PPCDeleteMessage
PowerUPKernel/PPCDeletePool
PowerUPKernel/PPCDeletePort
PowerUPKernel/PPCDeleteSemaphore
PowerUPKernel/PPCDivs64
PowerUPKernel/PPCDivs64p
PowerUPKernel/PPCDivu64
PowerUPKernel/PPCDivu64p
PowerUPKernel/PPCEnqueue
PowerUPKernel/PPCEnqueueSync
PowerUPKernel/PPCFindName
PowerUPKernel/PPCFindNameSync
PowerUPKernel/PPCFindTagItem
PowerUPKernel/PPCFindTask
PowerUPKernel/PPCFinishTask
PowerUPKernel/PPCFreeMem
PowerUPKernel/PPCFreePooled
PowerUPKernel/PPCFreeSignal
PowerUPKernel/PPCGetAttr
PowerUPKernel/PPCGetMessage
PowerUPKernel/PPCGetMessageAttr
PowerUPKernel/PPCGetTagData
PowerUPKernel/PPCGetTaskAttr
PowerUPKernel/PPCInsert
PowerUPKernel/PPCInsertSync
PowerUPKernel/PPCMods64
PowerUPKernel/PPCMods64p
PowerUPKernel/PPCModu64
PowerUPKernel/PPCModu64p
PowerUPKernel/PPCMuls64
PowerUPKernel/PPCMuls64p
PowerUPKernel/PPCMulu64
PowerUPKernel/PPCMulu64p
PowerUPKernel/PPCNeg64
PowerUPKernel/PPCNeg64p
PowerUPKernel/PPCNewList
PowerUPKernel/PPCNextTagItem
PowerUPKernel/PPCObtainPort
PowerUPKernel/PPCObtainSemaphore
PowerUPKernel/PPCObtainSemaphoreByName
PowerUPKernel/PPCObtainSemaphoreShared
PowerUPKernel/PPCObtainSemaphoreSharedByName
PowerUPKernel/PPCOpen
PowerUPKernel/PPCRawDoFmt
PowerUPKernel/PPCRead
PowerUPKernel/PPCReleasePort
PowerUPKernel/PPCReleaseSemaphore
PowerUPKernel/PPCRemHead
PowerUPKernel/PPCRemHeadSync
PowerUPKernel/PPCRemove
PowerUPKernel/PPCRemoveSync
PowerUPKernel/PPCRemTail
PowerUPKernel/PPCRemTailSync
PowerUPKernel/PPCReplyMessage
PowerUPKernel/PPCRevision
PowerUPKernel/PPCSeek
PowerUPKernel/PPCSendMessage
PowerUPKernel/PPCSetSignal
PowerUPKernel/PPCSignal
PowerUPKernel/PPCSub64
PowerUPKernel/PPCSub64p
PowerUPKernel/PPCVersion
PowerUPKernel/PPCWait
PowerUPKernel/PPCWaitPort
PowerUPKernel/PPCWrite
ppc.library/PPCFreeVecPooled
PowerUPKernel/PPCAdd64 PowerUPKernel/PPCAdd64
NAME
PPCAdd64 -- Add 2 64bit integers
SYNOPSIS
Result = PPCAdd64(highA,lowA,highB,lowB )
gpr3:gpr4 gpr3 gpr4 gpr5 gpr6
long PPCAdd64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Adds 2 64bit integers and returns the 64bit result in 2
32bit registers.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCAdd64p()
PowerUPKernel/PPCAdd64p PowerUPKernel/PPCAdd64p
NAME
PPCAdd64p -- Add 2 64bit integers
SYNOPSIS
PPCAdd64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
void PPCAdd64p(long long*,long long*);
FUNCTION
Adds 2 64bit integers and returns the 64bit result in
A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
SEE ALSO
PPCAdd64()
PowerUPKernel/PPCAddHead PowerUPKernel/PPCAddHead
NAME
PPCAddHead -- insert node at the head of a list
SYNOPSIS
PPCAddHead(list, node)
gpr3 gpr4
void PPCAddHead(struct List *, struct Node *)
FUNCTION
Add a node to the head of a doubly linked list.
WARNING
This function does not arbitrate for access to the list. The
calling task must be the owner of the involved list.
INPUTS
list - a pointer to the target list header
node - the node to insert at head
SEE ALSO
PPCAddTail(), PPCEnqueue(), PPCInsert(), PPCRemove(),
PPCRemHead(), PPCRemTail()
PowerUPKernel/PPCAddHeadSync PowerUPKernel/PPCAddHeadSync
NAME
PPCAddHeadSync -- insert node at the head of a list
SYNOPSIS
PPCAddHeadSync(list, node)
gpr3 gpr4
void PPCAddHeadSync(struct List *, struct Node *)
FUNCTION
Add a node to the head of a doubly linked list.
INPUTS
list - a pointer to the target list header
node - the node to insert at head
SEE ALSO
PPCAddTailSync(), PPCEnqueueSync(), PPCInsertSync(),
PPCRemoveSync(), PPCRemHeadSync(), PPCRemTailSync()
PowerUPKernel/PPCAddTail PowerUPKernel/PPCAddTail
NAME
PPCAddTail -- append node to tail of a list
SYNOPSIS
PPCAddTail(list, node)
gpr3 gpr4
void PPCAddTail(struct List *, struct Node *);
FUNCTION
Add a node to the tail of a doubly linked list.
WARNING
This function does not arbitrate for access to the list. The
calling task must be the owner of the involved list.
INPUTS
list - a pointer to the target list header
node - a pointer to the node to insert at tail of the list
SEE ALSO
PPCAddHead(), PPCEnqueue(), PPCInsert(), PPCRemove(),
PPCRemHead(), PPCRemTail()
PowerUPKernel/PPCAddTailSync PowerUPKernel/PPCAddTailSync
NAME
PPCAddTailSync -- append node to tail of a list
SYNOPSIS
PPCAddTailSync(list, node)
gpr3 gpr4
void PPCAddTailSync(struct List *, struct Node *);
FUNCTION
Add a node to the tail of a doubly linked list.
INPUTS
list - a pointer to the target list header
node - a pointer to the node to insert at tail of the list
SEE ALSO
PPCAddHeadSync(), PPCEnqueueSync(), PPCInsertSync(),
PPCRemoveSync(), PPCRemHeadSync(), PPCRemTailSync()
PowerUPKernel/PPCAllocMem PowerUPKernel/PPCAllocMem
NAME
PPCAllocMem -- Alloc a PPC cache aligned memory block
SYNOPSIS
Memory = PPCAllocMem(size,attributes )
gpr3 gpr3 gpr4
void *PPCAllocMem(ULONG,ULONG);
FUNCTION
Allocates a memoryblock which is aligned to the PPC cache lines.
You should only use the PPC with memblocks allocated through
this function.
INPUTS
Size - memory block size
Attributes - memory attributes
o exec/memory.h attributes
o MEMF_NOCACHESYNCPPC for a synchronized non cacheable mapped
memory area on the PPC side. The Amiga side is still copyback then.
o MEMF_NOCACHESYNCM68k for a synchronized non cacheable mapped
memory area on the M68k side. The PPC side is still copyback then.
If you use the M68k and PPC attribute at the same time the memory
is mapped noncacheable on both sides. This also means that your
allocation is 4096 Bytes aligned that may waste memory if you need
less ram.
RESULT
Memory - ptr to the memory block
NOTES
The reason for this routine is that there's a serious
cache copyback problem when ppc and 68060 cache lines
cross borders. Then the contents of the memory isn't guranteed.
The cache issue is explained in detail in Docs/PowerUP.guide
SEE ALSO
PPCFreeMem, exec/memory.h
PowerUPKernel/PPCAllocPooled PowerUPKernel/PPCAllocPooled
NAME
PPCAllocPooled -- Allocate memory with the pool manager
SYNOPSIS
memory=PPCAllocPooled(poolHeader,memSize)
gpr3 gpr3 gpr4
void *PPCAllocPooled(void *,ULONG);
FUNCTION
Allocate memSize bytes of memory, and return a pointer. NULL is
returned if the allocation fails.
Doing a DeletePool() on the pool will free all of the puddles
and thus all of the allocations done with AllocPooled() in that
pool. (No need to FreePooled() each allocation)
INPUTS
memSize - the number of bytes to allocate
poolHeader - a specific private pool header.
RESULT
A pointer to the memory, or NULL.
The memory block returned is long word aligned.
NOTES
The pool function do not protect an individual pool from
multiple accesses. The reason is that in most cases the pools
will be used by a single task. If your pool is going to
be used by more than one task you must Semaphore protect
the pool from having more than one task trying to allocate
within the same pool at the same time.
SEE ALSO
PPCFreePooled(), PPCCreatePool(), PPCDeletePool()
PowerUPKernel/PPCAllocSignal PowerUPKernel/PPCAllocSignal
NAME
PPCAllocSignal -- allocate a PPC task signal bit
SYNOPSIS
signalNum = PPCAllocSignal(signalNum)
gpr3 gpr3
BYTE PPCAllocSignal(BYTE);
FUNCTION
Allocate a signal bit from the current PPC task's free signals.
Either a particular bit, or the next free bit may be allocated.
The signal associated with the bit will be properly initialized
(cleared).
At least 16 user signals are available per task. Signals should
be deallocated before the task exits.
If the signal is already in use (or no free signals are available)
a -1 is returned.
Allocated signals are only valid for use with the task that
allocated them.
INPUTS
signalNum - the desired signal number {of 0..31} or -1 for no
preference.
RESULTS
signalNum - the signal bit number allocated {0..31}. If no signals
are available, this function returns -1.
SEE ALSO
PPCFreeSignal()
PowerUPKernel/PPCAllocVec PowerUPKernel/PPCAllocVec
NAME
PPCAllocVec -- allocate memory and keep track of the size (V36)
SYNOPSIS
memoryBlock = PPCAllocVec(byteSize, attributes)
gpr3 gpr3 gpr4
void *PPCAllocVec(ULONG, ULONG);
INPUTS
Size - memory block size
Attributes - memory attributes
o exec/memory.h attributes
o MEMF_NOCACHESYNCPPC for a synchronized non cacheable mapped
memory area on the PPC side. The Amiga side is still copyback then.
o MEMF_NOCACHESYNCM68k for a synchronized non cacheable mapped
memory area on the M68k side. The PPC side is still copyback then.
If you use the M68k and PPC attribute at the same time the memory
is mapped noncacheable on both sides. This also means that your
allocation is 4096 Bytes aligned that may waste memory if you need
less ram.
RESULT
Memory - ptr to the memory block
FUNCTION
This function works identically to AllocMem(), but tracks the size
of the allocation.
See the PPCAllocMem() documentation for details.
WARNING
The result of any memory allocation MUST be checked, and a viable
error handling path taken. ANY allocation may fail if memory has
been filled.
The cache issue is explained in detail in Docs/PowerUP.guide
SEE ALSO
PPCFreeVec(), PPCAllocMem()
PowerUPKernel/PPCAllocVecPooled PowerUPKernel/PPCAllocVecPooled
NAME
PPCAllocVecPooled -- allocate memory with the pool manager and keep track of
the size
SYNOPSIS
memoryBlock = PPCAllocVecPooled(Pool,byteSize)
gpr3 gpr3 gpr4
void *PPCAllocVecPooled(void*, ULONG);
FUNCTION
This function works identically to PPCAllocPooled(), but tracks the size
of the allocation.
See the PPCAllocMem() documentation for details.
SEE ALSO
PPCFreeVecPooled(), exec/memory.h, ppclib/memory.h
PowerUPKernel/PPCAttemptSemaphore PowerUPKernel/PPCAttemptSemaphore
NAME
PPCAttemptSemaphore -- try to obtain without blocking
SYNOPSIS
success = PPCAttemptSemaphore(Semaphore)
gpr3 gpr3
LONG PPCAttemptSemaphore(void*);
FUNCTION
This call is similar to PPCObtainSemaphore(), except that it will not
block if the semaphore could not be locked.
INPUT
Semaphore -- a semaphore object returned by PPCCreateSemaphore()
RESULT
success -- TRUE if the semaphore was locked, false if some
other task already possessed the semaphore.
SEE ALSO
PPCObtainSemaphoreShared(), PPCObtainSemaphoreByName(),
PPCReleaseSemaphore(), PPCAttemptSemaphoreShared(),
PPCAttemptSemaphoreByName()
PowerUPKernel/PPCAttemptSemaphoreByNameowerUPKernel/PPCAttemptSemaphoreByName
NAME
PPCAttemptSemaphoreByName - Attempt a public Semaphore
SYNOPSIS
Semaphore = PPCAttemptSemaphoreByName(Name,Error)
gpr3 gpr3 gpr4
void* PPCAttemptSemaphoreByName(char *,ULONG *)
FUNCTION
Tries to find a Semaphore and does an PPCAttemptSemaphore.
No Arbitration needed.
If it succeeds the Result is TRUE and if doesn't find it
it returns the error reason at the address you given as
the ErrorPtr.
Current ErrorCodes are PPCSEMAPHOREERROR_SEMAPHORENOTFOUND or
PPCSEMAPHOREERROR_OBTAINED when the attempt hadn't succeed.
INPUTS
Name - Ptr to the name cstring
Error - Ptr to an error result field
RESULTS
Semaphore - If FALSE no Semaphore with that name was found
SEE ALSO
PPCAttemptSemaphore(), PPCObtainSemaphoreByName()
PowerUPKernel/PPCAttemptSemaphoreSharedowerUPKernel/PPCAttemptSemaphoreShared
NAME
PPCAttemptSemaphoreShared -- try to obtain without blocking
SYNOPSIS
success = PPCAttemptSemaphoreShared(Semaphore)
gpr3 gpr3
BOOL PPCAttemptSemaphoreShared(void*);
FUNCTION
This call is similar to PPCObtainSemaphoreShared(), except that it
will not block if the semaphore could not be locked.
INPUT
Semaphore -- a semaphore object returned by PPCCreateSemaphore()
RESULT
success -- TRUE if the semaphore was granted, false if some
other task already possessed the semaphore in exclusive mode.
SEE ALSO
PPCObtainSemaphoreShared(), PPCObtainSemaphoreByName(),
PPCReleaseSemaphore(), PPCAttemptSemaphore(),
PPCAttemptSemaphoreByName()
PowerUPKernel/PPCAttemptSemaphoreSharedByName/PPCAttemptSemaphoreSharedByName
NAME
PPCAttemptSemaphoreSharedByName - Attempt a public Semaphore shared
SYNOPSIS
Semaphore = PPCAttemptSemaphoreSharedByName(Name,Error)
gpr3 gpr3 gpr4
void* PPCAttemptSemaphoreSharedByName(char *,ULONG *)
FUNCTION
Tries to find a Semaphore and does an PPCAttemptSemaphoreShared.
No Arbitration needed.
If it succeeds the Result is TRUE and if doesn't find it
it returns the error reason at the address you given as
the ErrorPtr.
Current ErrorCodes are PPCSEMAPHOREERROR_SEMAPHORENOTFOUND or
PPCSEMAPHOREERROR_OBTAINED when the attempt hadn't succeed.
INPUTS
Name - Ptr to the name cstring
Error - Ptr to an error result field
RESULTS
Semaphore - If FALSE no Semaphore with that name was found
SEE ALSO
PPCAttemptSemaphoreShared(), PPCObtainSemaphoreSharedByName()
PowerUPKernel/PPCCacheFlush PowerUPKernel/PPCCacheFlush
NAME
PPCCacheFlush - User callable custom cache clearing
SYNOPSIS
PPCCacheFlush(Address,Length)
gpr3 gpr4
void PPCCacheFlush(APTR,ULONG);
FUNCTION
Flush out the contents of the instruction and Data PPC cache in
a certain address space. Useful to optimize the shared memory
handling because flushing the whole cache may not what you
want.
If dirty data cache lines are present, push them to memory first.
Caches must be cleared after *any* operation that could cause
invalid or stale data. The most common cases are DMA,modifying
instructions using the processor or modifying Data which is
shared by the 680xx and PPC.
ATTENTION
Please read the PowerUP.guide Cache chapter before you use
this function.
SEE ALSO
PPCCacheFlushAll(), PPCCacheInvalid()
PowerUPKernel/PPCCacheFlushAll PowerUPKernel/PPCCacheFlushAll
NAME
PPCCacheFlushAll - User callable simple cache clearing
SYNOPSIS
PPCCacheFlushAll()
void PPCCacheFlushAll(void);
FUNCTION
Flush out the contents of the instruction and Data PPC cache.
If dirty data cache lines are present, push them to memory first.
Caches must be cleared after *any* operation that could cause
invalid or stale data. The most common cases are DMA,modifying
instructions using the processor or modifying Data which is
shared by the 680xx and PPC.
ATTENTION
Please read the PowerUP.guide Cache chapter before you use
this function.
SEE ALSO
PPCCacheFlush(), PPCCacheInvalid()
PowerUPKernel/PPCCacheInvalid PowerUPKernel/PPCCacheInvalid
NAME
PPCCacheInvalid - User callable custom cache invalidating
SYNOPSIS
PPCCacheInvalid(Address,Length)
gpr3 gpr4
void PPCCacheInvalid(APTR,ULONG);
FUNCTION
Invalid the contents of the instruction and Data PPC cache in
a certain address space. Useful to optimize the shared memory
handling because flushing the whole cache may not what you
want. This function doesn`t write back the contents of the used
dirty cache lines.
Be also aware that the Address must be PPC cache line aligned,
to avoid that you invalid cache lines you partly use.
ATTENTION
Please read the PowerUP.guide Cache chapter before you use
this function.
SEE ALSO
PPCCacheFlushAll(), PPCCacheFlush()
PowerUPKernel/PPCCallM68k PowerUPKernel/PPCCallM68k
NAME
PPCCallM68k -- Calls a M68k Function
SYNOPSIS
PPCCallM68k(Caos)
gpr3
ULONG PPCCallM68k(struct Caos*);
FUNCTION
Calls a m68k function and returns the result. You have
to be very careful with what the function does.
INPUTS
Caos - The lib,offset,register structure
EXAMPLE
Caos.caos_Un.Function - needs the function address
Caos.d0-a6 - take the parameters
NOTE
This function won`t be supported by a recompile
for the ABox OS. It may only run in an AmigaOS
emulation.
DESCRIPTION
For calling functions from the PPC under M68k AmigaOS or for
calling functions on the PPC Supervisor mode you have to care
for the cache issues. Please read the Cache chapter in the
docs/powerup.guide about the cache problems involved.
If you do something wrong here you can expect that you loose
data, get wrong data or simply crash the machine.
The caos register fields are updated with the register values
when the M68k function exits.(V45)
IF_CACHEFLUSHNO:
You use this mode for the cpu if your function
touches no memory both cpus use.
Example: Close(File)
If you call this function by the PPC there`s no need
to flush the cache because the PPC isn`t allowed to
touch any memory which has to do with the File BPTR.
ATTENTION:
The PPC MUST NOT be used to poke into AmigaOS system
structures.
IF_CACHEFLUSHALL:
You use this mode for the cpu if your function
touches memory both cpus use and it`s no simple memory area
which may be flushed individually. This should be used by default.
Example: OpenWindowTagList(NewWindow,TagList)
Here you pass a complex data structure which may use
memory areas at several different areas.
IF_CACHEFLUSHAREA:
You use this mode for the cpu if your function
touches memory both cpus use and it`s a memory area which isn`t
very big. It depends on the size and how many lines are dirty
if this is faster than IF_CACHEFLUSHALL.
With the Start and Length fields of each cpu you can define
the area.
Example: Write(File,Address,Length)
When the PPC runs this function the PPC must make sure
that all data in the to be written memory area is in
in the memory and not only in the cache.
IF_CACHEINVALIDAREA: (V45)
You use this mode for the cpu if your function
touches memory both cpus use and it`s a memory area where you
don`t care for valid data anymore.
With the Start and Length fields of each cpu you can define
the area.
Example: Read(File,Address,Length)
When the PPC runs this function the PPC has no need
anymore for anything which is in its cache for the
area the Address and Length define, so you could
invalidate this instead of doing a cacheflush which
may write back dirty lines.
Be VERY careful about this.
ATTENTION! The Address must be 32Byte aligned, so you should always
use PPCAllocMem for data which is used on the M68k and PPC
You are NOT allowed to use normal pools for exchanging data between
the M68k and PPC.
IF_ASYNC: (V45)
If you use this flag, the function is called asynchronous and
the PPC doesn`t have to wait for a result.
This flag is only checked in the M68kCacheMode field.
This also means that the result of the PPCCall#? function
is meaningless.
Normally this flag doesn`t really fit into a CacheMode flag, but
well..too bad i haven`t declared another flag field there.
SEE ALSO
PPCCallOS()
PowerUPKernel/PPCCallOS PowerUPKernel/PPCCallOS
NAME
PPCCallOS -- Calls an OS Library Function
SYNOPSIS
PPCCallOS(Caos)
gpr3
ULONG PPCCallOS(struct Caos*);
FUNCTION
Calls an OS function and returns the result. You have
to be very careful which function you call. With
FD2Inline you can create all inline AmigaOS inline calls.
INPUTS
Caos - The lib,offset,register structure
EXAMPLE
PPCAllocMem(Size,Attribute):
Caos.caos_Un.Offset = LVO_AllocMem;
Caos.d0 = Size;
Caos.d1 = Attribute;
Caos.a6 = SysBase;
NOTE
This function isn`t source portable to the next
OS. It may only run in an AmigaOS emulation.
DESCRIPTION
For calling functions from the PPC under M68k AmigaOS or for
calling functions on the PPC Supervisor mode you have to care
for the cache issues. Please read the Cache chapter in the
docs/powerup.guide about the cache problems involved.
If you do something wrong here you can expect that you loose
data, get wrong data or simply crash the machine.
IF_CACHEFLUSHNO:
You use this mode for the cpu if your function
touches no memory both cpus use.
Example: Close(File)
If you call this function by the PPC there`s no need
to flush the cache because the PPC isn`t allowed to
touch any memory which has to do with the File BPTR.
ATTENTION:
The PPC MUST NOT be used to poke into AmigaOS system
structures.
IF_CACHEFLUSHALL:
You use this mode for the cpu if your function
touches memory both cpus use and it`s no simple memory area
which may be flushed individually. This should be used by default.
Example: OpenWindowTagList(NewWindow,TagList)
Here you pass a complex data structure which may use
memory areas at several different areas.
IF_CACHEFLUSHAREA:
You use this mode for the cpu if your function
touches memory both cpus use and it`s a memory area which isn`t
very big. It depends on the size and how many lines are dirty
if this is faster than IF_CACHEFLUSHALL.
With the Start and Length fields of each cpu you can define
the area.
Example: Write(File,Address,Length)
When the PPC runs this function the PPC must make sure
that all data in the to be written memory area is in
in the memory and not only in the cache.
IF_CACHEINVALIDAREA: (V45)
You use this mode for the cpu if your function
touches memory both cpus use and it`s a memory area where you
don`t care for valid data anymore.
With the Start and Length fields of each cpu you can define
the area.
Example: Read(File,Address,Length)
When the PPC runs this function the PPC has no need
anymore for anything which is in its cache for the
area the Address and Length define, so you could
invalidate this instead of doing a cacheflush which
may write back dirty lines.
Be VERY careful about this.
ATTENTION! The Address must be 32Byte aligned, so you should always
use PPCAllocMem for data which is used on the M68k and PPC
You are NOT allowed to use normal pools for exchanging data between
the M68k and PPC.
IF_ASYNC: (V45)
If you use this flag, the function is called asynchronous and
the PPC doesn`t have to wait for a result.
This flag is only checked in the M68kCacheMode field.
This also means that the result of the PPCCall#? function
is meaningless.
Normally this flag doesn`t really fit into a CacheMode flag, but
well..too bad i haven`t declared another flag field there.
SEE ALSO
CallM68k()
PowerUPKernel/PPCClose PowerUPKernel/PPCClose
NAME
PPCClose -- Close an open file
SYNOPSIS
success = PPCClose( file )
gpr3 gpr3
BOOL PPCClose(BPTR)
FUNCTION
This function is equal to the dos.library/Close function.
It works on the context of the Msg Task each PPC Task has
on the AmigaOS side.
INPUTS
file - BCPL pointer to a file handle
RESULTS
success - returns if PPCClose() succeeded.
SEE ALSO
PPCOpen(), PPCRead(), PPCWrite(), PPCSeek()
PowerUPKernel/PPCCmp64 PowerUPKernel/PPCCmp64
NAME
PPCCmp64 -- Compare 2 64bit integers
SYNOPSIS
Result = PPCCmp64(highA,lowA,highB,lowB )
gpr3 gpr3 gpr4 gpr5 gpr6
int PPCCmp64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Compares 2 64bit integers and returns the state of
the comparision.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 0 A=B
+1 A>B
-1 A<B
SEE ALSO
PPCCmp64p()
PowerUPKernel/PPCCmp64p PowerUPKernel/PPCCmp64p
NAME
PPCCmp64p -- Compare 2 64bit integers
SYNOPSIS
Result = PPCCmp64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
LONG PPCCmp64p(long long*,long long*);
FUNCTION
Compares 2 64bit integers and returns the state of
the comparision.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
RESULT
Result - 0 A=B
+1 A>B
-1 A<B
SEE ALSO
PPCCmp64()
PowerUPKernel/PPCCreateMessage PowerUPKernel/PPCCreateMessage
NAME
PPCCreateMessage -- Create a Message for a PPCMsgPort
SYNOPSIS
Message = PPCCreateMessage(PPCPort,Length)
gpr3 gpr3 gpr4
void* PPCCreateMessage(void*,ULONG);
FUNCTION
Creates a Message for PPCPort communication.
The Length parameter may be useful in the future to optimize
messages in certain addressspace mappings for IPC in a MP system.
It isn`t necessary to specify a Length which is > max(DataSize)
but it may result in a performance win in the future.
A message and msgdata can`t be reused or touched after a SendMessage
until the message was replied.
INPUTS
PPCPort - Ptr to an object generated by PPCCreatePort
Length - Max Length for Messages
RESULT
PPCMessage - PPCMessage Object ptr.
SEE ALSO
PPCDeleteMessage(), ppclib/message.h
PowerUPKernel/PPCCreatePool PowerUPKernel/PPCCreatePool
NAME
PPCCreatePool -- Generate a private memory pool header
SYNOPSIS
newPool=PPCCreatePool(memFlags,puddleSize,threshSize)
gpr3 gpr3 gpr4 gpr5
void *PPCCreatePool(ULONG,ULONG,ULONG);
FUNCTION
Allocate and prepare a new memory pool header. Each pool is a
separate tracking system for memory of a specific type. Any number
of pools may exist in the system.
Pools automatically expand and shrink based on demand. Fixed sized
"puddles" are allocated by the pool manager when more total memory
is needed. Many small allocations can fit in a single puddle.
Allocations larger than the threshSize are allocation in their own
puddles.
At any time individual allocations may be freed. Or, the entire
pool may be removed in a single step.
INPUTS
memFlags - a memory flags specifier, as taken by AllocMem.
o exec/memory.h attributes
o MEMF_NOCACHESYNCPPC for a synchronized non cacheable mapped
memory area on the PPC side. The Amiga side is still copyback then.
o MEMF_NOCACHESYNCM68k for a synchronized non cacheable mapped
memory area on the M68k side. The PPC side is still copyback then.
If you use the M68k and PPC attribute at the same time the memory
is mapped noncacheable on both sides. This also means that your
allocation is 4096 Bytes aligned that may waste memory if you need
less ram.
puddleSize - the size of Puddles...
threshSize - the largest allocation that goes into normal puddles
This *MUST* be less than or equal to puddleSize
(CreatePool() will fail if it is not)
RESULT
The address of a new pool header, or NULL for error.
SEE ALSO
PPCDeletePool(), PPCAllocPooled(), PPCFreePooled(), exec/memory.i
PowerUPKernel/PPCCreatePort PowerUPKernel/PPCCreatePort
NAME
PPCCreatePort -- Create a PPC Message Port
SYNOPSIS
Port = PPCCreatePort(Tags)
gpr3 gpr3
void* PPCCreatePort(struct TagItem*);
FUNCTION
Creates a local PPC MsgPort to receive messages from the PPC.
With a specified name you can mark it public to the ppc.library.
This shouldn`t be missunderstood as a public system port because
PPCPorts and Amigaports are different entities.
INPUTS
Tags - Tags to specify a public port for example.
o PPCPORTTAG_NAME,"Name"
defines the name of a public PPC port.
o PPCPORTTAG_ERROR,(ULONG*) ErrorPtr
defines the ptr for a more precise return error result
RESULT
Port - the PPCPort object or NULL
SEE ALSO
PPCDeletePort(), ppclib/message.h
PowerUPKernel/PPCCreateSemaphore PowerUPKernel/PPCCreateSemaphore
NAME
PPCCreateSemaphore - Create a semaphore object
SYNOPSIS
PPCCreateSemaphore(Tags)
gpr3
void* PPCCreateSemaphoreA(struct TagItem *Tags)
FUNCTION
creates a Semaphore object for the usage with the semaphore functions.
INPUTS
MyTags - Here you have to specify all needed Tags.
RESULTS
Semaphore - If NULL the error code is available through the
SEMAPHORETAG_ERROR
SEE ALSO
PPCObtainSemaphore(), PPCObtainSemaphoreByName(),
PPCReleaseSemaphore(), PPCObtainSemaphoreShared(),
PPCAttemptSemaphore(), PPCAttemptSemaphoreByName()
PowerUPKernel/PPCDeleteMessage PowerUPKernel/PPCDeleteMessage
NAME
PPCDeleteMessage -- Delete a PPC Message
SYNOPSIS
PPCDeleteMessage(PPCMessage)
gpr3
void PPCDeleteMessage(void*);
FUNCTION
Deletes a PPC Message. You can only delete a msg your
task allocated and which has already been replied or not
send out.
INPUTS
PPCMessage - Ptr to an object generated by PPCCreateMessage
SEE ALSO
PPCCreatePort(), ppclib/message.h
PowerUPKernel/PPCDeletePool PowerUPKernel/PPCDeletePool
NAME
PPCDeletePool -- Drain an entire memory pool
SYNOPSIS
PPCDeletePool(poolHeader)
gpr3
void PPCDeletePool(void *);
FUNCTION
Frees all memory in all pudles of the specified pool header, then
deletes the pool header. Individual free calls are not needed.
INPUTS
poolHeader - as returned by CreatePool().
SEE ALSO
PPCCreatePool(), PPCAllocPooled(), PPCFreePooled()
PowerUPKernel/PPCDeletePort PowerUPKernel/PPCDeletePort
NAME
PPCDeletePort -- Delete a PPC Message Port
SYNOPSIS
Success = PPCDeletePort(PPCPort)
gpr3 gpr3
BOOL PPCDeletePort(void*);
FUNCTION
Deletes a local PPC MsgPort when the Port isn`t obtained
by somebody else. If it`s obtained it returns FALSE so
you have to decide yourself how you wanna recover this
problem which maybe caused by a synchronizing problem
between your M68k and PPC applications
INPUTS
PPCPort - PPCPort object generated by PPCCreatePort
SEE ALSO
PPCCreatePort,ppclib/message.h
PowerUPKernel/PPCDeleteSemaphore PowerUPKernel/PPCDeleteSemaphore
NAME
PPCDeleteSemaphore - Delete Semaphore
SYNOPSIS
PPCDeleteSemaphore(Semaphore)
gpr3
void PPCDeleteSemaphore(void*)
FUNCTION
deletes a Semaphore. If it can't delete it because
of a remaining a PPCObtainSemaphore, the semaphore
is deleted afterwards.
INPUTS
Semaphore -- a semaphore object returned by PPCCreateSemaphore()
SEE ALSO
PPCCreateSemaphore()
PowerUPKernel/PPCDivs64 PowerUPKernel/PPCDivs64
NAME
PPCDivs64 -- Divide 2 signed 64bit integers
SYNOPSIS
Result = PPCDivs64(highA,lowA,highB,lowB )
gpr3:gpr4 gpr3 gpr4 gpr5 gpr6
long PPCDivs64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Multiplies 2 signed 64bit integers and
returns the 64bit result in A.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCDivs64p()
PowerUPKernel/PPCDivs64p PowerUPKernel/PPCDivs64p
NAME
PPCDivs64p -- Divide 2 signed 64bit integers
SYNOPSIS
PPCDivs64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
void PPCDivs64p(long long*,long long*);
FUNCTION
Multiplies 2 signed 64bit integers and
returns the 64bit result in A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
SEE ALSO
PPCDivs64()
PowerUPKernel/PPCDivu64 PowerUPKernel/PPCDivu64
NAME
PPCDivu64 -- Divide 2 unsigned 64bit integers
SYNOPSIS
Result = PPCDivu64(highA,lowA,highB,lowB )
gpr3:gpr4 gpr3 gpr4 gpr5 gpr6
long PPCDivu64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Multiplies 2 unsigned 64bit integers and
returns the 64bit result in A.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCDivu64p()
PowerUPKernel/PPCDivu64p PowerUPKernel/PPCDivu64p
NAME
PPCDivu64p -- Divide 2 unsigned 64bit integers
SYNOPSIS
PPCDivu64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
void PPCDivu64p(long long*,long long*);
FUNCTION
Multiplies 2 unsigned 64bit integers and
returns the 64bit result in A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
SEE ALSO
PPCDivu64()
PowerUPKernel/PPCEnqueue PowerUPKernel/PPCEnqueue
NAME
PPCEnqueue -- insert or append node to a system queue
SYNOPSIS
PPCEnqueue(list, node)
gpr3 gpr4
void PPCEnqueue(struct List *, struct Node *);
FUNCTION
Insert or append a node into a system queue. The insert is
performed based on the node priority -- it will keep the list
properly sorted. New nodes will be inserted in front of the first
node with a lower priority. Hence a FIFO queue for nodes of equal
priority
WARNING
This function does not arbitrate for access to the list. The
calling task must be the owner of the involved list.
INPUTS
list - a pointer to the system queue header
node - the node to enqueue. This must be a full featured node
with type, priority and name fields.
SEE ALSO
PPCAddHead(), PPCAddTail(), PPCInsert(), PPCRemove(),
PPCRemHead(), PPCRemTail()
PowerUPKernel/PPCEnqueueSync PowerUPKernel/PPCEnqueueSync
NAME
PPCEnqueueSync -- insert or append node to a system queue
SYNOPSIS
PPCEnqueueSync(list, node)
gpr3 gpr4
void PPCEnqueueSync(struct List *, struct Node *);
FUNCTION
Insert or append a node into a system queue. The insert is
performed based on the node priority -- it will keep the list
properly sorted. New nodes will be inserted in front of the first
node with a lower priority. Hence a FIFO queue for nodes of equal
priority
INPUTS
list - a pointer to the system queue header
node - the node to enqueue. This must be a full featured node
with type, priority and name fields.
SEE ALSO
PPCAddHeadSync(), PPCAddTailSync(), PPCInsertSync(),
PPCRemoveSync(), PPCRemHeadSync(), PPCRemTailSync()
PowerUPKernel/PPCFindName PowerUPKernel/PPCFindName
NAME
PPCFindName -- find a system list node with a given name
SYNOPSIS
node = PPCFindName(start, name)
gpr3 gpr3 gpr4
struct Node *PPCFindName(struct List *, STRPTR);
FUNCTION
Traverse a system list until a node with the given name is found.
To find multiple occurrences of a string, this function may be
called with a node starting point.
WARNING
This function does not arbitrate for access to the list. The
calling task must be the owner of the involved list.
INPUTS
start - a list header or a list node to start the search
(if node, this one is skipped)
name - a pointer to a name string terminated with NULL
RESULTS
node - a pointer to the node with the same name else
NULL to indicate that the string was not found.
PowerUPKernel/PPCFindNameSync PowerUPKernel/PPCFindNameSync
NAME
PPCFindNameSync -- find a system list node with a given name
SYNOPSIS
node = PPCFindNameSync(start, name)
gpr3 gpr3 gpr4
struct Node *PPCFindNameSync(struct List *, STRPTR);
FUNCTION
Traverse a system list until a node with the given name is found.
To find multiple occurrences of a string, this function may be
called with a node starting point.
INPUTS
start - a list header or a list node to start the search
(if node, this one is skipped)
name - a pointer to a name string terminated with NULL
RESULTS
node - a pointer to the node with the same name else
zero to indicate that the string was not found.
PowerUPKernel/PPCFindTagItem PowerUPKernel/PPCFindTagItem
NAME
PPCFindTagItem -- Scans TagItem list for a Tag.
SYNOPSIS
tag = PPCFindTagItem( tagVal, tagList)
gpr3 gpr3 gpr4
struct TagItem *PPCFindTagItem(Tag tagVal,struct TagItem *tagList);
FUNCTION
Scans a TagItem "List", which is in fact a chain of arrays
of TagItem structures as defined in utility/tagitem.h.
Returns a pointer to the FIRST item with ti_Tag matching the
'TagVal' parameter.
INPUTS
tagVal - Tag value to search for.
tagList - beginning of TagItem list to scan.
RESULT
Returns a pointer to the item with ti_Tag matching 'TagVal'.
Returns NULL if there is no match or if TagList is NULL.
SEE ALSO
utility/tagitem.h, PPCGetTagData(), PPCNextTagItem()
PowerUPKernel/PPCFindTask PowerUPKernel/PPCFindTask
NAME
PPCFindTask -- find a PPC task with the given name or find oneself
SYNOPSIS
task = PPCFindTask(name)
gpr3 gpr4
void* PPCFindTask(char*);
FUNCTION
This function will check all PPC task queues for a task with
the given name, and return a pointer to its task control block.
If a NULL name pointer is given a pointer to the current task
will be returned.
Finding oneself with a NULL for the name is very quick. Finding a
task by name is very system expensive, and will disable PPCTask
switching for a long time.
INPUT
name - pointer to a name string
RESULT
PPCtask - PPCTask Object
PowerUPKernel/PPCFinishTask PowerUPKernel/PPCFinishTask
NAME
PPCFinishTask -- End your PPC Task
SYNOPSIS
PPCFindishTask(Result)
void PPCFinishTask(ULONG)
FUNCTION
Ends the current task and removes it from the tasklist.
Then it sends the M68k Msgtask the Finish Msg which may
send back the Startup message or notify the debugger
by the exit of the ppc task.
This function doesn`t free the ElfObject.
RESULT
Result - Result code of the task.
SEE ALSO
ppc.library/PPCDeleteTask()
PowerUPKernel/PPCFreeMem PowerUPKernel/PPCFreeMem
NAME
PPCFreeMem -- Frees a PPC cache aligned memory block
SYNOPSIS
PPCFreeMem(Memory,size)
gpr3 gpr4
void PPCFreeMem(APTR,ULONG);
FUNCTION
Frees a memoryblock which was allocated by PPCAllocMem
INPUTS
MemoryBlock - memory block
Size - memory block size
NOTES
The reason for this routine is that there's a serious
cache copyback problem when ppc cache line and 68060 cache line
cross borders. Then the contents of the memory isn't guranteed.
The cache issue is explained in detail in Docs/PowerUP.guide
SEE ALSO
PPCAllocMem(), exec/memory.h
PowerUPKernel/PPCFreePooled PowerUPKernel/PPCFreePooled
NAME
PPCFreePooled -- Free pooled memory
SYNOPSIS
PPCFreePooled(poolHeader,memory,memSize)
gpr3 gpr4 gpr5
void PPCFreePooled(void *,void *,ULONG);
FUNCTION
Deallocates memory allocated by AllocPooled(). The size of the
allocation *MUST* match the size given to AllocPooled().
The reason the pool functions do not track individual allocation
sizes is because many of the uses of pools have small allocation
sizes and the tracking of the size would be a large overhead.
Only memory allocated by AllocPooled() may be freed with this
function!
Doing a DeletePool() on the pool will free all of the puddles
and thus all of the allocations done with AllocPooled() in that
pool. (No need to FreePooled() each allocation)
INPUTS
memory - pointer to memory allocated by AllocPooled.
poolHeader - a specific private pool header.
NOTES
The pool function do not protect an individual pool from
multiple accesses. The reason is that in most cases the pools
will be used by a single task. If your pool is going to
be used by more than one task you must Semaphore protect
the pool from having more than one task trying to allocate
within the same pool at the same time.
SEE ALSO
PPCAllocPooled(), PPCCreatePool(), PPCDeletePool()
PowerUPKernel/PPCFreeSignal PowerUPKernel/PPCFreeSignal
NAME
PPCFreeSignal -- free a signal PPC task bit
SYNOPSIS
PPCFreeSignal(signalNum)
gpr3
void PPCFreeSignal(BYTE);
FUNCTION
This function frees a previously allocated signal bit for reuse.
This call must be performed while running in the same PPC task
in which the signal was allocated.
INPUTS
signalNum - the signal number to free {0..31}.
SEE ALSO
PPCAllocSignal()
PowerUPKernel/PPCGetAttr PowerUPKernel/PPCGetAttr
NAME
PPCGetAttr -- Get PPC Attr (V45)
SYNOPSIS
Result = PPCGetAttrs(Tag)
gpr3 gpr3
ULONG PPCGetAttr(ULONG);
FUNCTION
Gives you infos about the PPC enviroment depending on the tag.
INPUTS
Tags - The supported tags
o PPCINFOTAG_CPU
returns the version of the processor to detect the PPC
type the system is running on. See your PowerPC Manuals
"pvr" descriptions and check out the include "/ppclib/ppc.h.
Use the ti_Data field as the processor number.
o PPCINFOTAG_CPUREV
returns the revision of the processor.
Use the ti_Data field as the processor number.
o PPCINFOTAG_CPUCOUNT
returns the numbers of processors
o PPCINFOTAG_CPUCLOCK
returns the clock of the cpu in Mhz.
Use the ti_Data field as the processor number.
o PPCINFOTAG_CPUPLL
returns the clock devider of the cpu.
Use the ti_Data field as the processor number.
RESULT
result - depends on the requested Tags
SEE ALSO
ppclib/ppc.h
PowerUPKernel/PPCGetMessage PowerUPKernel/PPCGetMessage
NAME
PPCGetMessage -- Gets a PPC Message from a PPC Port
SYNOPSIS
Message = PPCGetMessage(PPCPort)
gpr3 gpr3
void* PPCGetMessage(void*);
FUNCTION
Checks for a message in the PPCPort`s msglist and removes
it from the queue.
Until you haven`t replied the PPC Message you can read from
the embedded Data field informations. You MUST NOT write to
these informations.
INPUTS
PPCPort - Ptr to PPC Port
RESULT
PPCMessage - First PPC Message in the PPC Port msglist or NULL if the
the msglist is empty.
SEE ALSO
PPCReplyMessage(), PPCCreateMessage(), ppclib/message.h
PowerUPKernel/PPCGetMessageAttr PowerUPKernel/PPCGetMessageAttr
NAME
PPCGetMessageAttr -- Get Infos about a PPC Message
SYNOPSIS
Result = PPCGetMessageAttr(PPCMessage,Attr)
gpr3 gpr3 gpr4
ULONG PPCGetMessageAttr(void*,ULONG);
FUNCTION
Returns informations about a PPC Message. This way you
can get a Ptr to the Data the message transports and
the length of the message.
INPUTS
PPCMessage - Ptr to an object generated by PPCCreateMessage
Attr - Information Attribute
o PPCMSGTAG_DATA
returns the Data parameter of the PPC Message.
The Data field is most of a time a memory ptr
but if the length of the message is 0 it can
also be used as an additional msgid.
o PPCMSGTAG_DATALENGTH
returns the Length of the PPC Message. If the
Length is NULL this Message needed no cacheflush
and therefore is very fast. If Length is NULL the
the Data field can be used as an additional msgid.
o PPCMSGTAG_MSGID
returns the MSGID of the PPC Message. This may be
useful to mark certain msgs to be from a certain
type which may simplify the handling of messages.
RESULT
Result - Returns the informations you requested by the
attribute.
SEE ALSO
PPCGetMessage(), ppclib/message.h
PowerUPKernel/PPCGetTagData PowerUPKernel/PPCGetTagData
NAME
PPCGetTagData -- Obtain data corresponding to Tag.
SYNOPSIS
value = PPCGetTagData(tagVal, default, tagList)
gpr3 gpr3 gpr4 gpr5
ULONG PPCGetTagData(Tag TagVal, ULONG Default, struct TagItem *TagList)
FUNCTION
Searches a TagItem list for a matching Tag value, and returns the
corresponding ti_Data value for the TagItem found. If none
found, will return the value passed it as 'default'.
INPUTS
tagVal - Tag value to search for.
default - value to be returned if tagVal is not found.
tagList - the TagItem list to search.
RESULT
value - The ti_Data value for first matching TagItem, or
'default' if a ti_Tag matching 'Tag' is not found.
SEE ALSO
utility/tagitem.h, PPCFindTagItem(), PPCNextTagItem()
PowerUPKernel/PPCGetTaskAttr PowerUPKernel/PPCGetTaskAttr
NAME
PPCGetTaskAttr -- Get PPC Task Attributes
SYNOPSIS
Result = PPCGetTaskAttr(Tag)
gpr3 gpr3
ULONG PPCGetTaskAttr(ULONG);
FUNCTION
Gives you infos about your task. This function isn`t as flexible
the AmigaOS PowerUPKernel function. Please check the include which
Tag you can use.
INPUTS
Tag - the information you want.
o PPCTASKTAG_STARTUP_MSG
returns the PPCTask`s startup msg. This msg will be replied
by the PowerUPKernel after the PPC Task ends so you can use
this to know that the PPCTask is gone so a PPCUnloadObject()
is save. On the PPC side you can use it as a method to pass
data.
o PPCTASKTAG_STARTUP_MSGDATA
returns the startup`s MsgData. This data field can be used
to pass startup data to the PPC. Like some M68k msgport for
example.
o PPCTASKTAG_STARTUP_MSGLENGTH
returns the startup`s MsgLength.
o PPCTASKTAG_STARTUP_MSGID
returns the startup`s MsgID.
o PPCTASKTAG_MSGPORT
returns the PPCPort which belongs to the PPCTask. If you
haven`t asked for one in PPCCreateTask() the function returns
NULL.
o PPCTASKTAG_STACKSIZE
returns the size of the task`s stack.
RESULT
result - depends on the requested Tag
SEE ALSO
PowerUP/PPCLib/ppc_tasks.h
PowerUPKernel/PPCInsert PowerUPKernel/PPCInsert
NAME
PPCInsert -- insert a node into a list
SYNOPSIS
PPCInsert(list, node, listNode)
gpr3 gpr4 gpr5
void PPCInsert(struct List*, struct Node*, struct Node*);
FUNCTION
Insert a node into a doubly linked list AFTER a given node
position. Insertion at the head of a list is possible by
passing a NULL listNode, though the PPCAddHead() function is
slightly faster for that special case.
WARNING
This function does not arbitrate for access to the list. The
calling task must be the owner of the involved list.
INPUTS
list - a pointer to the target list header
node - the node to insert
listNode - the node after which to insert
SEE ALSO
PPCAddHead(), PPCAddTail(), PPCEnqueue(), PPCRemHead(),
PPCRemove(), PPCRemTail()
PowerUPKernel/PPCInsertSync PowerUPKernel/PPCInsertSync
NAME
PPCInsertSync -- insert a node into a list
SYNOPSIS
PPCInsertSync(list, node, listNode)
gpr3 gpr4 gpr5
void PPCInsertSync(struct List *, struct Node *, struct Node *);
FUNCTION
Insert a node into a doubly linked list AFTER a given node
position. Insertion at the head of a list is possible by
passing a NULL listNode, though the PPCAddHead() function
is slightly faster for that special case.
INPUTS
list - a pointer to the target list header
node - the node to insert
listNode - the node after which to insert
SEE ALSO
PPCAddHeadSync(), PPCAddTailSync(), PPCEnqueueSync(),
PPCRemHeadSync(), PPCRemoveSync(), PPCRemTailSync()
PowerUPKernel/PPCMods64 PowerUPKernel/PPCMods64
NAME
PPCMods64 -- Modulus 2 signed 64bit integers
SYNOPSIS
Result = PPCMods64(highA,lowA,highB,lowB )
gpr3:gpr4 gpr3 gpr4 gpr5 gpr6
long PPCMods64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Multiplies 2 signed 64bit integers and
returns the 64bit result in A.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCMods64p()
PowerUPKernel/PPCMods64p PowerUPKernel/PPCMods64p
NAME
PPCMods64p -- Modulus 2 signed 64bit integers
SYNOPSIS
PPCMods64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
void PPCMods64p(long long*,long long*);
FUNCTION
Multiplies 2 signed 64bit integers and
returns the 64bit result in A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
SEE ALSO
PPCMods64()
PowerUPKernel/PPCModu64 PowerUPKernel/PPCModu64
NAME
PPCModu64 -- Modulus 2 unsigned 64bit integers
SYNOPSIS
Result = PPCModu64(highA,lowA,highB,lowB )
gpr3:gpr4 gpr3 gpr4 gpr5 gpr6
long PPCModu64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Multiplies 2 unsigned 64bit integers and
returns the 64bit result in A.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCModu64p()
PowerUPKernel/PPCModu64p PowerUPKernel/PPCModu64p
NAME
PPCModu64p -- Modulus 2 unsigned 64bit integers
SYNOPSIS
PPCModu64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
void PPCModu64p(long long*,long long*);
FUNCTION
Multiplies 2 unsigned 64bit integers and
returns the 64bit result in A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
SEE ALSO
PPCModu64()
PowerUPKernel/PPCMuls64 PowerUPKernel/PPCMuls64
NAME
PPCMuls64 -- Multiply 2 signed 64bit integers
SYNOPSIS
Result = PPCMuls64(highA,lowA,highB,lowB )
gpr3:gpr4 gpr3 gpr4 gpr5 gpr6
long PPCMuls64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Multiplies 2 signed 64bit integers and
returns the 64bit result in A.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCMuls64p()
PowerUPKernel/PPCMuls64p PowerUPKernel/PPCMuls64p
NAME
PPCMuls64p -- Multiply 2 signed 64bit integers
SYNOPSIS
PPCMuls64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
void PPCMuls64p(long long*,long long*);
FUNCTION
Multiplies 2 signed 64bit integers and
returns the 64bit result in A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
SEE ALSO
PPCMuls64()
PowerUPKernel/PPCMulu64 PowerUPKernel/PPCMulu64
NAME
PPCMulu64 -- Multiply 2 unsigned 64bit integers
SYNOPSIS
Result = PPCMulu64(highA,lowA,highB,lowB )
gpr3:gpr4 gpr3 gpr4 gpr5 gpr6
long PPCMulu64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Multiplies 2 unsigned 64bit integers and
returns the 64bit result in A.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCMulu64p()
PowerUPKernel/PPCMulu64p PowerUPKernel/PPCMulu64p
NAME
PPCMulu64p -- Multiply 2 unsigned 64bit integers
SYNOPSIS
PPCMulu64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
void PPCMulu64p(long long*,long long*);
FUNCTION
Multiplies 2 unsigned 64bit integers and
returns the 64bit result in A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
SEE ALSO
PPCMulu64()
PowerUPKernel/PPCNeg64 PowerUPKernel/PPCNeg64
NAME
PPCNeg64 -- Negate a 64bit integer
SYNOPSIS
Result = PPCNeg64(highA,lowA)
gpr3:gpr4 gpr3 gpr4
long PPCNeg64(ULONG,ULONG);
FUNCTION
Negates a 64bit integers and returns the 64bit result in 2
32bit registers.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCNeg64p()
PowerUPKernel/PPCNeg64p PowerUPKernel/PPCNeg64p
NAME
PPCNeg64p -- Negate a 64bit integer
SYNOPSIS
PPCNeg64p(ValueAPtr)
gpr3
void PPCNeg64p(long long*);
FUNCTION
Negates a 64bit integer and returns the 64bit result in
A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
SEE ALSO
PPCNeg64()
PowerUPKernel/PPCNewList PowerUPKernel/PPCNewList
NAME
PPCNewList - Initialize a list (minlist) header...
SYNOPSIS
PPCNewList(list)
gpr3
VOID PPCNewList(struct List *);
VOID PPCNewList(struct MinList *);
FUNCTION
Initializes a List so it can be used by list operations.
INPUTS
list - pointer to a List or MinList.
SEE ALSO
<exec/lists.h>
PowerUPKernel/PPCNextTagItem PowerUPKernel/PPCNextTagItem
NAME
PPCNextTagItem -- Iterate TagItem lists.
SYNOPSIS
next_tag = PPCNextTagItem(tagItemPtr )
D0 gpr3
struct TagItem *PPCNextTagItem(struct TagItem **tagItemPtr);
FUNCTION
Iterates through a (chained) array of TagItem structures,
skipping and chaining as dictated by system tags. TAG_SKIP
will cause it to skip the entry and the next, TAG_IGNORE ignores
that single entry, and TAG_MORE has a pointer to another array
of tags (and terminates the current array!) TAG_DONE also
terminates the current array. Each call returns either the next
tagitem you should examine, or NULL at the end.
INPUTS
tagItemPtr - doubly-indirect reference to a TagItem structure.
The pointer will be changed to keep track of the
iteration.
RESULT
next_tag - Each TagItem in the array or chain of arrays that
should be processed according to system Tag values
(in utility/tagitem.h) is returned in turn with
successive calls.
EXAMPLE
Iterate( struct TagItem *tags );
{
struct TagItem *tstate;
struct TagItem *tag;
tstate = tags;
while ( tag = NextTagItem( &tstate ) )
{
switch ( tag->ti_Tag )
{
case TAG1:
...
break;
case TAG2:
...
break;
...
}
}
}
NOTES
Do NOT use the value of *tagItemPtr, but rather use the pointer
returned by PPCNextTagItem().
SEE ALSO
utility/tagitem.h, PPCGetTagData(), PPCFindTagItem()
PowerUPKernel/PPCObtainPort PowerUPKernel/PPCObtainPort
NAME
PPCObtainPort -- Obtain a PPC Message Port
SYNOPSIS
Port = PPCObtainPort(Tags)
gpr3 gpr3
void* PPCObtainPort(struct TagItem*);
FUNCTION
searches a public PPC MsgPort on the local processor or
all processor. A search on the network may also be possible
in the future.
INPUTS
Tags - Tags to specify a public port for example.
o PPCPORTTAG_NAME,"Name"
defines the name of the PPC port you want to obtain
o PPCPORTTAG_ERROR,(ULONG*) ErrorPtr
defines the ptr for a more precise return error result
RESULT
PPCPort - PPCPort object generated by PPCCreatePort
SEE ALSO
PPCReleasePort(), ppclib/message.h
PowerUPKernel/PPCObtainSemaphore PowerUPKernel/PPCObtainSemaphore
NAME
PPCObtainSemaphore -- gain exclusive access to a semaphore
SYNOPSIS
PPCObtainSemaphore(Semaphore)
gpr3
void ObtainSemaphore(void*);
FUNCTION
Semaphores are used to gain exclusive access to an object.
PPCObtainSemaphore is the call used to gain this access. If another
user currently has the semaphore locked the call will block until
the object is available.
If the current PPC task already has locked the semaphore and attempts to
lock it again the call will still succeed. A "nesting count" is
incremented each time the current owning task of the semaphore calls
PPCObtainSemaphore(). This counter is decremented each time
PPCReleaseSemaphore() is called. When the counter returns to zero the
semaphore is actually released, and the next waiting task is called.
A queue of waiting tasks is maintained on the stacks of the waiting
tasks. Each will be called in turn as soon as the current task
releases the semaphore.
INPUT
Semaphore -- a semaphore object returned by PPCCreateSemaphore()
SEE ALSO
PPCObtainSemaphoreShared(), PPCObtainSemaphoreByName(),
PPCReleaseSemaphore(), PPCAttemptSemaphore(),
PPCAttemptSemaphoreByName()
PowerUPKernel/PPCObtainSemaphoreByName PowerUPKernel/PPCObtainSemaphoreByName
NAME
PPCObtainSemaphoreByName - Obtain a public Semaphore
SYNOPSIS
Semaphore = PPCObtainSemaphoreByName(Name)
gpr3 gpr3
void* PPCObtainSemaphoreByName(char *)
FUNCTION
Tries to find a Semaphore and obtains it.
No Arbitration needed.
INPUTS
Name - Ptr to the name cstring
RESULTS
Semaphore - If NULL no Semaphore with that name was found
SEE ALSO
PPCAttemptSemaphoreByName()
PowerUPKernel/PPCObtainSemaphoreShared PowerUPKernel/PPCObtainSemaphoreShared
NAME
PPCObtainSemaphoreShared -- gain shared access to a semaphore
SYNOPSIS
PPCObtainSemaphoreShared(Semaphore)
gpr3
void PPCObtainSemaphoreShared(void*);
FUNCTION
A lock on a semaphore may either be exclusive, or shared.
Exclusive locks are granted by the ObtainSemaphore() and
PPCAttemptSemaphore() functions. Shared locks are granted by
PPCObtainSemaphoreShared(). Calls may be nested.
Any number of tasks may simultaneously hold a shared lock on a
semaphore. Only one task may hold an exclusive lock. A typical
application is a list that is often read, but only occasionally
written to.
Any exlusive locker will be held off until all shared lockers
release the semaphore. Likewise, if an exlusive lock is held,
all potential shared lockers will block until the exclusive lock
is released. All shared lockers are restarted at the same time.
EXAMPLE
ObtainSemaphoreShared(ss);
// read data
ReleaseSemaohore(ss);
ObtainSemaphore(ss);
// modify data
ReleaseSemaohore(ss);
INPUT
Semaphore -- a semaphore object returned by PPCCreateSemaphore()
SEE ALSO
PPCObtainSemaphore(), PPCObtainSemaphoreByName(),
PPCReleaseSemaphore(), PPCAttemptSemaphore(),
PPCAttemptSemaphoreByName()
PowerUPKernel/PPCObtainSemaphoreSharedByNameel/PPCObtainSemaphoreSharedByName
NAME
PPCObtainSemaphoreSharedByName - Obtain a public Semaphore shared
SYNOPSIS
Semaphore = PPCObtainSemaphoreSharedByName(Name)
gpr3 gpr3
void* PPCObtainSemaphoreSharedByName(char *)
FUNCTION
Tries to find a Semaphore and obtains it without blocking.
No Arbitration needed.
INPUTS
Name - Ptr to the name cstring
RESULTS
Semaphore - If NULL no Semaphore with that name was found
SEE ALSO
PPCObtainSemaphoreShared(), PPCAttemptSemaphoreSharedByName()
PowerUPKernel/PPCOpen PowerUPKernel/PPCOpen
NAME
PPCOpen -- Open a file for input or output
SYNOPSIS
file = PPCOpen( name, accessMode )
gpr3 gpr3 gpr4
BPTR PPCOpen(STRPTR, LONG)
FUNCTION
This function is equal to the dos.library/Open function.
It works on the context of the Msg Task each PPC Task has
on the AmigaOS side.
INPUTS
name - pointer to a null-terminated string
accessMode - integer
RESULTS
file - BCPL pointer to a file handle
SEE ALSO
PPCClose(), PPCRead(), PPCWrite(), PPCSeek()
PowerUPKernel/PPCRawDoFmt PowerUPKernel/PPCRawDoFmt
NAME
RawDoFmt -- format data into a character stream.
SYNOPSIS
NextData = PPCRawDoFmt(FormatString, DataStream, PutChProc, PutChData);
gpr3 gpr3 gpr4 gpr4 gpr5
APTR PPCRawDoFmt(STRPTR,APTR,void (*)(),APTR);
FUNCTION
perform "C"-language-like formatting of a data stream, outputting
the result a character at a time. Where % formatting commands are
found in the FormatString, they will be replaced with the
corresponding element in the DataStream. %% must be used in the
string if a % is desired in the output.
Under V36, RawDoFmt() returns a pointer to the end of the DataStream
(The next argument that would have been processed). This allows
multiple formatting passes to be made using the same data.
INPUTS
FormatString - a "C"-language-like NULL terminated format string,
with the following supported % options:
%[flags][width.limit][length]type
flags - only one allowed. '-' specifies left justification.
width - field width. If the first character is a '0', the
field will be padded with leading 0's.
. - must follow the field width, if specified
limit - maximum number of characters to output from a string.
(only valid for %s).
length - size of input data defaults to WORD for types d, x,
and c, 'l' changes this to long (32-bit).
type - supported types are:
b - BSTR, data is 32-bit BPTR to byte count followed
by a byte string, or NULL terminated byte string.
A NULL BPTR is treated as an empty string.
(Added in V36 exec)
d - decimal
u - unsigned decimal (Added in V37 exec)
x - hexadecimal
s - string, a 32-bit pointer to a NULL terminated
byte string. In V36, a NULL pointer is treated
as an empty string
c - character
DataStream - a stream of data that is interpreted according to
the format string. Often this is a pointer into
the task's stack.
PutChProc - the procedure to call with each character to be
output, called as:
PutChProc(Char, PutChData);
gpr3 gpr4
the procedure is called with a NULL Char at the end of
the format string.
IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
If PutChProc is == 0 it writes the character into the Buffer.
The buffer is the address PutChData points too.
If PutChProc is == 1 it writes the character to the serial line.
PutChData - a value that is passed through to the PutChProc
procedure. This is untouched by RawDoFmt, and may be
modified by the PutChProc.
WARNING
This Amiga ROM function formats word values in the data stream. If
your compiler defaults to longs, you must add an "l" to your
% specifications. This can get strange for characters, which might
look like "%lc".
SEE ALSO
Documentation on the C language "printf" call in any C language
reference book.
PowerUPKernel/PPCRead PowerUPKernel/PPCRead
NAME
PPCRead -- Read bytes of data from a file
SYNOPSIS
actualLength = PPCRead( file, buffer, length )
gpr3 gpr3 gpr4 gpr5
LONG PPCRead(BPTR, void *, LONG)
FUNCTION
This function is equal to the dos.library/Read function.
It works on the context of the Msg Task each PPC Task has
on the AmigaOS side.
ATTENTION
You must use PPCAllocMem() for the buffer, so it`s aligned
to the PPC cache lines.
INPUTS
file - BCPL pointer to a file handle
buffer - pointer to buffer
length - integer
RESULTS
actualLength - integer
SEE ALSO
PPCOpen(), PPCClose(), PPCWrite(), PPCSeek()
PowerUPKernel/PPCReleasePort PowerUPKernel/PPCReleasePort
NAME
PPCReleasePort -- Releases an obtained PPC Message Port
SYNOPSIS
Success = PPCReleasePort(PPCPort)
gpr3 gpr3
void PPCReleasePort(void*);
FUNCTION
Releases a PPC MsgPort, so it may be removed after nobody
needs it anymore.
INPUTS
PPCPort - Ptr to an object generated by PPCCreatePort
RESULT
Success - Boolean which says if the PPCPort could be released
successfully. If this fails the PPCPort is still obtained
by somebody else.
SEE ALSO
PPCObtainPort(), ppclib/message.h
PowerUPKernel/PPCReleaseSemaphore PowerUPKernel/PPCReleaseSemaphore
NAME
PPCReleaseSemaphore -- make semaphore available to others
SYNOPSIS
PPCReleaseSemaphore(Semaphore)
gpr3
void PPCReleaseSemaphore(void*);
FUNCTION
PPCReleaseSemaphore() is the inverse of PPCObtainSemaphore(). It makes
the semaphore lockable to other users. If tasks are waiting for
the semaphore and this this task is done with the semaphore then
the next waiting task is signalled.
Each PPCObtainSemaphore() call must be balanced by exactly one
PPCReleaseSemaphore() call. This is because there is a nesting count
maintained in the semaphore of the number of times that the current
task has locked the semaphore. The semaphore is not released to
other PPC tasks until the number of releases matches the number of
obtains.
Needless to say, havoc breaks out if the task releases more times
than it has obtained.
INPUT
Semaphore -- a semaphore object returned by PPCCreateSemaphore()
SEE ALSO
PPCObtainSemaphore(), PPCObtainSemaphoreShared()
PowerUPKernel/PPCRemHead PowerUPKernel/PPCRemHead
NAME
PPCRemHead -- remove the head node from a list
SYNOPSIS
node = PPCRemHead(list)
gpr3 gpr3
struct Node *PPCRemHead(struct List *);
FUNCTION
Get a pointer to the head node and remove it from the list.
WARNING
This function does not arbitrate for access to the list. The
calling task must be the owner of the involved list.
INPUTS
list - a pointer to the target list header
RESULT
node - the node removed or NULL when empty list
SEE ALSO
PPCAddHead(), PPCAddTail(), PPCEnqueue(), PPCInsert(),
PPCRemove(), PPCRemTail()
PowerUPKernel/PPCRemHeadSync PowerUPKernel/PPCRemHeadSync
NAME
PPCRemHeadSync -- remove the head node from a list
SYNOPSIS
node = PPCRemHeadSync(list)
gpr3 gpr3
struct Node *PPCRemHead(struct List *);
FUNCTION
Get a pointer to the head node and remove it from the list.
INPUTS
list - a pointer to the target list header
RESULT
node - the node removed or zero when empty list
SEE ALSO
PPCAddHeadSync(), PPCAddTailSync(), PPCEnqueueSync(),
PPCInsertSync(), PPCRemoveSync(), PPCRemTailSync()
PowerUPKernel/PPCRemove PowerUPKernel/PPCRemove
NAME
PPCRemove -- remove a node from a list
SYNOPSIS
PPCRemove(node)
gpr3
void PPCRemove(struct Node *);
FUNCTION
Unlink a node from whatever list it is in.
Nodes that are not part of a list must not
be passed to this function!
WARNING
This function does not arbitrate for access to the list. The
calling task must be the owner of the involved list.
INPUTS
node - the node to remove
SEE ALSO
PPCAddHead(), PPCAddTail(), PPCEnqueue(), PPCInsert(),
PPCRemHead(), PPCRemTail()
PowerUPKernel/PPCRemoveSync PowerUPKernel/PPCRemoveSync
NAME
PPCRemoveSync -- remove a node from a list
SYNOPSIS
PPCRemoveSync(node)
gpr3
void PPCRemoveSync(struct Node *);
FUNCTION
Unlink a node from whatever list it is in. Nodes
that are not part of a list must not be passed to
this function!
INPUTS
node - the node to remove
SEE ALSO
PPCAddHeadSync(), PPCAddTailSync(), PPCEnqueueSync(),
PPCInsertSync(), PPCRemHeadSync(), PPCRemTailSync()
PowerUPKernel/PPCRemTail PowerUPKernel/PPCRemTail
NAME
PPCRemTail -- remove the tail node from a list
SYNOPSIS
node = PPCRemTail(list)
gpr3 gpr3
struct Node *PPCRemTail(struct List *);
FUNCTION
Remove the last node from a list, and return a pointer to it.
If the list is empty, return NULL.
WARNING
This function does not arbitrate for access to the list. The
calling task must be the owner of the involved list.
INPUTS
list - a pointer to the target list header
RESULT
node - the node removed or NULL when empty list
SEE ALSO
PPCAddHead(), PPCAddTail(), PPCEnqueue(), PPCInsert(),
PPCRemove(), PPCRemHead(), PPCRemTail()
PowerUPKernel/PPCRemTailSync PowerUPKernel/PPCRemTailSync
NAME
PPCRemTailSync -- remove the tail node from a list
SYNOPSIS
node = PPCRemTailSync(list)
gpr3 gpr3
struct Node *PPCRemTailSync(struct List *);
FUNCTION
Remove the last node from a list, and return a pointer to it.
If the list is empty, return NULL.
INPUTS
list - a pointer to the target list header
RESULT
node - the node removed or zero when empty list
SEE ALSO
PPCAddHeadSync(), PPCAddTailSync(), PPCEnqueueSync(),
PPCInsertSync(), PPCRemoveSync(), PPCRemHeadSync(),
PPCRemTailSync()
PowerUPKernel/PPCReplyMessage PowerUPKernel/PPCReplyMessage
NAME
PPCReplyMessage -- Reply a PPC Message
SYNOPSIS
Success = PPCReplyMessage(PPCMessage)
gpr3
BOOL PPCReplyMessage(void*);
FUNCTION
Reply a PPC Message. After this operation the embedded Data
informations in the PPC Message isn`t valid anymore. The Message
itself is also not valid anymore so any access to the object is
not allowed.
INPUTS
PPCMessage - Ptr to an object generated by PPCCreateMessage
RESULT
Success - A Boolean tells you if the operation was successful.
SEE ALSO
PPCGetMessage(), ppclib/message.h
PowerUPKernel/PPCRevision PowerUPKernel/PPCRevision
NAME
PPCRevision -- Get Revision of the PowerUPKernel
SYNOPSIS
Revision = PPCRevision()
gpr3
ULONG PPCVersion()
FUNCTION
Returns the Revision of the PowerUPKernel, so software
is able to adapt to future changes.
RESULT
value - The Revision number of the PowerUPKernel
PowerUPKernel/PPCSeek PowerUPKernel/PPCSeek
NAME
PPCSeek -- Set the current position for reading and writing
SYNOPSIS
oldPosition = PPCSeek( file, position, mode )
gpr3 gpr3 gpr4 gpr5
LONG PPCSeek(BPTR, LONG, LONG)
FUNCTION
This function is equal to the dos.library/Seek function.
It works on the context of the Msg Task each PPC Task has
on the AmigaOS side.
INPUTS
file - BCPL pointer to a file handle
position - integer
mode - integer
RESULTS
oldPosition - integer
SEE ALSO
PPCOpen(), PPCClose(), PPCWrite(), PPCRead()
PowerUPKernel/PPCSendMessage PowerUPKernel/PPCSendMessage
NAME
PPCSendMessage -- Sends a PPC Message to a PPC Port
SYNOPSIS
Success = PPCSendMessage(PPCPort,PPCMessage,Data,Length,MsgID)
gpr3 gpr3 gpr4 gpr5 gpr6 gpr7
BOOL PPCSendMessage(void*,void*,void*,ULONG,ULONG);
FUNCTION
Sends a PPC Message to a PPC Port which may be controlled
by the M68k oder PPC. This way you can pass data between
the PPC and the M68k in an abstract way which will be source
compatible on the A\BOX OS. After you`ve sent a message
you MUST NOT change the Data until your task received a reply.
If you only want to send a quick 32Bit Msg to the target task
use Data as a 32bit Msg value and Length=0.
This way no Cache is flushed.
INPUTS
PPCPort - Ptr to an object generated by PPCCreatePort
PPCMessage - Ptr to an object generated by PPCCreateMessage
Data - Ptr to the Data you wanna send or additional MsgID
if the Length field is 0.
Length - Length of the Data you wanna send.
MsgID - MsgID code you may use for your msg type detection
RESULT
Success - A Boolean tells you if the operation was successful.
SEE ALSO
PPCReplyMessage(), ppclib/message.h
PowerUPKernel/PPCSetSignal PowerUPKernel/PPCSetSignal
NAME
PPCSetSignal -- define the state of this ppctask's signals
SYNOPSIS
oldSignals = PPCSetSignal(newSignals, signalMask)
gpr3 gpr3 gpr4
ULONG PPCSetSignal(ULONG, ULONG)
FUNCTION
This function defines the states of the ppctask's signalmask.
This way you can check for break signals easily.
INPUTS
newSignals - the new values for the signals specified in
signalSet.
signalMask - the set of signals to be effected
RESULTS
oldSignals - the prior values for all signals
EXAMPLE
Get the current state of all signals:
PPCSetSignal(0,0)
Clear all signals:
PPCSetSignal(0,FFFFFFFFH)
SEE ALSO
PPCSignal(), PPCWait()
PowerUPKernel/PPCSignal PowerUPKernel/PPCSignal
NAME
PPCSignal -- signal a PPC task
SYNOPSIS
PPCSignal(PPCTask, signals)
gpr3 gpr4
void PPCSignal(void*,ULONG);
FUNCTION
This function signals a PPC task with the given signals.
If the task is currently waiting for one or more of these
signals, it will be made ready and a reschedule will occur.
If the task is not waiting for any of these signals, the
signals will be posted to the task for possible later use.
A signal may be sent to a task regardless of whether it is
running, ready, or waiting.
This function is considered "low level". Its main purpose
is to support multiple higher level functions like PPCSendMessage.
INPUT
task - the task to be signalled
signals - the signals to be sent
SEE ALSO
PPCWait(), PPCSetSignal(), PPCSendMessage()
PowerUPKernel/PPCSub64 PowerUPKernel/PPCSub64
NAME
PPCSub64 -- Sub 2 64bit integers
SYNOPSIS
Result = PPCSub64(highA,lowA,highB,lowB )
gpr3:gpr4 gpr3 gpr4 gpr5 gpr6
long PPCSub64(ULONG,ULONG,ULONG,ULONG);
FUNCTION
Subtracts 2 64bit integers and returns the 64bit result in 2
32bit registers.
INPUTS
highA - upper 32bit of value A
lowA - lower 32bit of value A
highB - upper 32bit of value B
lowB - lower 32bit of value B
RESULT
Result - 64Bit result devided into 2 registers
SEE ALSO
PPCSub64p()
PowerUPKernel/PPCSub64p PowerUPKernel/PPCSub64p
NAME
PPCSub64p -- Sub 2 64bit integers
SYNOPSIS
PPCSub64p(ValueAPtr,ValueBPtr)
gpr3 gpr4
void PPCSub64p(long long*,long long*);
FUNCTION
Subtracts 2 64bit integers and returns the 64bit result in
A.
INPUTS
ValueAPtr - Ptr to 64Bit value A
ValueBPtr - Ptr to 64Bit value B
SEE ALSO
PPCSub64()
PowerUPKernel/PPCVersion PowerUPKernel/PPCVersion
NAME
PPCVersion -- Get Version of the PowerUPKernel
SYNOPSIS
Version = PPCVersion()
gpr3
ULONG PPCVersion()
FUNCTION
Returns the Version of the PowerUPKernel, so software
is able to adapt to future changes.
RESULT
value - The version number of the PowerUPKernel
PowerUPKernel/PPCWait PowerUPKernel/PPCWait
NAME
PPCWait -- wait for one or more signals
SYNOPSIS
signals = PPCWait(signalSet)
gpr3 gpr3
ULONG PPCWait(ULONG);
FUNCTION
This function will cause the current PPC task to suspend
waiting for one or more signals.
When one or more of the specified signals are received,
the task will return to the ready state, and those signals
will be cleared.
If a signal occurred prior to calling PPCWait(), the wait
condition will be immediately satisfied, and the task will
continue to run without any delay.
INPUT
signalSet - The set of signals for which to wait.
Each bit represents a particular signal.
RESULTS
signals - the set of signals that were active
SEE ALSO
PPCSignal(), PPCSetSignal()
PowerUPKernel/PPCWaitPort PowerUPKernel/PPCWaitPort
NAME
PPCWaitPort -- wait for a given PPC Msgport to be non-empty
SYNOPSIS
PPCMessage = PPCWaitPort(PPCPort)
gpr3 gpr3
void* PPCWaitPort(void*);
FUNCTION
This function waits for the given PPC Msgport to become non-empty.
If necessary, the Wait function will be called to wait for
the port signal. If a message is already present at the
port, this function will return immediately. The return
value is always a pointer to the first PPC Message queued (but
it is not removed from the queue.
INPUT
PPCPort - a pointer to the PPC Message port
RESULT
PPCMessage - a pointer to the first PPC Message in the PPCPort msglist.
SEE ALSO
PPCGetMessage(), ppclib/message.h
PowerUPKernel/PPCWrite PowerUPKernel/PPCWrite
NAME
PPCWrite -- Write bytes of data to a file
SYNOPSIS
returnedLength = PPCWrite( file, buffer, length )
gpr3 gpr3 gpr4 gpr5
LONG PPCWrite(BPTR, void *, LONG)
FUNCTION
This function is equal to the dos.library/Write function.
It works on the context of the Msg Task each PPC Task has
on the AmigaOS side.
ATTENTION
You must use PPCAllocMem() for the buffer, so it`s aligned
to the PPC cache lines.
INPUTS
file - BCPL pointer to a file handle
buffer - pointer to the buffer
length - integer
RESULTS
returnedLength - integer
SEE ALSO
PPCOpen(), PPCClose(), PPCSeek(), PPCRead()
ppc.library/PPCFreeVecPooled ppc.library/PPCFreeVecPooled
NAME
PPCFreeVecPooled -- return PPCAllocVecPooled() memory to the system
SYNOPSIS
PPCFreeVecPooled(Pool,memoryBlock)
gpr3 gpr4
void PPCFreeVecPooled(void*,void *);
FUNCTION
Free an allocation made by the PPCAllocVecPooled() call. The memory will
be returned to the system pool from which it came.
INPUTS
memoryBlock - pointer to the memory block to free, or NULL.
SEE ALSO
PPCAllocVecPooled()